Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@masa-finance/masa-sdk

Package Overview
Dependencies
Maintainers
5
Versions
374
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@masa-finance/masa-sdk

Brand new masa SDK

  • 0.3.11
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
341
increased by847.22%
Maintainers
5
Weekly downloads
 
Created
Source

🌽🌽 THIS IS BETA SOFTWARE. IT COULD LEAD TO RAPID UNSCHEDULED DISASSEMBLY. If you run into problems, please open up a new issue. 🌽🌽


  • Installation

Installation

yarn
yarn add @masa-finance/masa-sdk --save

npm
npm i @masa-finance/masa-sdk --save

Usage

Browser:

import { Masa } from "@masa-finance/masa-sdk";
import { ethers } from "ethers";

// with metamask
const provider = new ethers.providers.Web3Provider(window.ethereum);
const signer = provider.getSigner();

export const masa = new Masa({ wallet: signer });

Node:

import { Masa } from "@masa-finance/masa-sdk";
import { ethers } from "ethers";

const provider = new ethers.providers.JsonRpcProvider(
  "your blockchain rpc endpoint"
);

const wallet = new ethers.Wallet("your private key", provider);

export const masa = new Masa({ wallet });

Interface

For a detailed interface description see Masa

Configuration

KeyTypeDescriptionDefault Value
cookiestringCookie value. Don't set this manually unless you know what you do!
walletethers.Signer or ethers.WalletThe Wallet instance to use when interacting with the Blockchain."wallet with a random private key"
apiUrlstringThe API Endpoint of the Masa Infrastructure for dev, test, beta and production."https://dev.middleware.masa.finance/"
environmentstringThe environment to use dev, test, beta, production."dev"
networkstringThe network name ie. "goerli"."goerli"
arweave.hoststringThe arweave host to use for loading metadata."arweave.net"
arweave.portnumberThe arweave port to use for loading metadata.443
arweave.protocolstringThe arweave protocol to use for loading metadata."https"
arweave.loggingbooleanTurn arweave logging on or off.false
new Masa({
  // cookie value for connecting with the backend
  cookie: "my fancy cookie",
  // wallet object is always mandatory
  wallet,
  // api endpoint to the masa infrastructure
  apiUrl: "https://middleware.masa.finance",
  // masa environment dev, test, beta, prod
  environment: "prod",
  // network name to use goerli, mainnet
  network: "goerli",
  // arweave endpoint to use
  arweave: {
    host: "arweave.net",
    port: 443,
    protocol: "https",
    logging: false,
  },
});

Keywords

FAQs

Package last updated on 09 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc